<?php

use App\Http\Controllers\Api\Client\BrowseController;
use App\Http\Controllers\Api\Client\Favorites;
use App\Http\Controllers\Api\Client\OrderController;
use App\Http\Controllers\Api\Client\SystemController;
use App\Http\Controllers\Api\Client\UserInifController;
use App\Http\Controllers\Api\Client\wantedHouseController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\ClientLoginController;
use App\Http\Controllers\Api\ClientHomeController;
use App\Http\Controllers\Api\Client\feedbackController;

/* 
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::group(['namespace'=>'api','prefix'=>'hhn','middleware'=>'throttle:100'],function (){
   Route::post('client_login_get_code',[ClientLoginController::class,'getCode']);
   Route::post('client_login_phone',[ClientLoginController::class,'phoneLogin']);
   Route::get('client_home',[ClientHomeController::class,'clientHome']);
});

//桑开心
Route::group(['namespace'=>'api','prefix'=>'skx','middleware'=>'throttle:100'],function (){
    //获取用户信息
    Route::get('getUserInif',[UserInifController::class,'getUserInif']);
    //获取用户系统信息
    Route::get('getUserSystemMessages',[SystemController::class,'getUserSystemMessages']);
    //获取用户收藏和发布的房源列表
    Route::get('getFavorites',[Favorites::class,'getUserFavoritesList']);
    //获取浏览记录
    Route::get('GetBrowseList',[BrowseController::class,'getUserBrowse']);

    Route::get('house_attr', [wantedHouseController::class, 'getHouseData']);//获取区域
    Route::post('wanted_house', [wantedHouseController::class, 'releaseSaleHouse']);//发布求租信息

    //获取用户支付明细
    Route::get('getUserOrder', [OrderController::class, 'getOrderList']);

    //客户端 问题反馈表单添加
    Route::post('addFeedback', [feedbackController::class, 'feedbackAddData']);

});
